GTAIV .Net Script Hook v0.86 BETA
(C) 2009 Hazard (hazard_x@gmx.net)

based on the GTAIV C++ Script Hook from Aru <oneforaru at gmail dot com>



1. Description
--------------

This ASI plugin allows you to run ingame GTAIV scripts written
in any .Net language. Those languages are easy to learn and use,
while they are still extremely powerful.
One noteable aspect of this hook is, that the scripting functions
are organized in a .Net-typical class structure, which makes
finding functions intuitive and easy.
And since you are able to develop scripts with Visual Studio,
you'll get all benefits like code highlighting and IntelliSense.

You need an AsiLoader to use this plugin in GTAIV. See the
Requirements section below for more info.

Special thanks to Aru for his help and for his C++ Script Hook.
This plugin wouldn't be possible without it.

You can get Aru's C++ Script Hook here:
http://www.gtaforums.com/index.php?showtopic=390582


2. Disclaimer
-------------

This software is provided 'as-is', without any explicit or implied
warranty. The author(s) cannot be held accountable for any damage
that might be caused by this software or any of it's components.


3. Requirements
---------------

Required to run this plugin are:

 - GTA IV patched to version 1.0.2.0 or version 1.0.1.0
 - Microsoft .Net Framework 2.0 installed on your machine
 - Any AsiLoader installed for GTA IV


I've included download links below. If the application crashes or
behaves in an unwanted manner then download and install those
updates/tools.

The .Net Framework SHOULD be installed already after the GTA IV
installation.


.Net Framework 3.5 Download:
http://www.microsoft.com/downloads/details.aspx?FamilyID=333325fd-ae52-4e35-b531-508d977d32a6

.Net Framework 2.0 Download (only needed if you can't install v3.5 for some reason) :
http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5

YAASIL - Yet Another Asi Loader:
http://www.gtaforums.com/index.php?showtopic=394806

Alexander Blade's AsiLoader:
http://www.gtaforums.com/index.php?showtopic=380830

listener's XLiveLess, including an AsiLoader:
http://www.gtaforums.com/index.php?showtopic=388658


4. Installation
---------------

 - EASY: 

Extract the complete archive into your GTAIV installation folder.


 - DETAILED:

Extract the complete archive into your GTAIV installation folder.
Make sure that the ScriptHookDotNet.asi is in your main GTAIV
folder, or any other folder that is supported by your AsiLoader.

Only the ScriptHookDotNet.asi file is required to run scripts.
All files in the "scripts\for Developers" subfolder are only 
required if you want to write own scripts. Look at the "Writing
new scripts" section for more infos on this.


5. Script Installation
----------------------

Scripts for the DotNet Script Hook have to be copied to the
"scripts" subfolder of your GTAIV installation directory.
You may have to create the folder if it is not there.

DotNet scripts may have one of the following file formats:
 *.vb       - for plain VisualBasic.Net scripts
 *.cs       - for plain C# scripts
 *.net      - for compiled scripts in any .Net language
 *.net.dll  - for compiled scripts in any .Net language


6. Writing new scripts
----------------------

Look at the "scripts\for Developers" folder you extracted to
your GTA IV folder earlier. It contains example projects
to start with. You could just edit the vb or cs script files
with Notepad and copy the resulting script to the "scripts"
subfolder of your GTAIV directory.

However, coding will be MUCH more comfortable and easy if you
use Visual Studio to edit your scripts. Look below for a free
download. Open the SLN Project files with Visual Studio to get
ready-to-compile script examples. Use those examples as a base
for your own scripts.
If you want to create a completely new VS project, make sure
that you add a reference to the included ScriptHookDotNet.dll.
This file is ONLY required for coding. On runtime, your
scripts will automatically use the ScriptHookDotNet.asi that
is located in your GTAIV directory. Thus you don't need to
bundle your script with one of those files when you want to
release it. If you don't want to release the plain  vb or cs
script files, you can use the compiled DLL. You just have to
make sure that the file ends to ".net.dll" or just ".net"!

If a script does not run, take a look at the logfile
ScriptHookDotNet.log . It will write down all errors that
occur during compiling or runtime.

Do NOT include ScriptHookDotNet.asi or ScriptHookDotNet.dll
in the release of your script! Link to this thread instead!

Free Visual Studio Express downloads (registration is free too):
http://www.microsoft.com/express/download/default.aspx


7. Deinstallation
-----------------

Just delete the ScriptHookDotNet.asi from your GTAIV folder.

Scripts contained in the "scripts" subfolder can remain there
if you wish to keep them. They wont run or interfere with the
game when ScriptHookDotNet.asi is deleted.


8. Changelog
------------

Version 0.86 BETA:
- removed Startup from scripts. You can now use all functions and also Wait() inside the constructor.
- Replaced all events that required a method override with actual events, conformant with the .Net standard.
- Updated the examples accordingly. Look at them to see how to apply the changes to your scripts.
- The PhoneNumberDialed event is now also available in game version 1.0.1.0
- some other minor changes

Version 0.85 BETA:
- fixed serveral bugs in the new threading architecture
- fixed all reported AccessViolations
- fixed custom cameras. they work now as intended.
- added ScriptCommands to allow communication between scripts (see the included ScriptCommunication example)
- added easy settings (ini) file support (just access "Settings" in your scripts)
- added methods to store Metadata for Objects. Metadata can be stored/read as long as the object exists.
- added ability to catch dialed phone numbers in scripts (PhoneNumberDialed & BindPhoneNumber)
- added "ScriptHelp" console command, which displays general info and bound console commands of scripts.
- added more functions to the Graphics class.
- you can scroll in the console now using the PageUp/Down keys (hold Shift to get to start/end immediately)
- use Shift + NumpadPlus/Minus to grow/shrink the console
- more stuff, as usual

Version 0.84 BETA:
- Complete rewrite of the internal scripting and thread structure. Crashes on Game & Script reloading should be gone now!
- added easy to use Euphoria (NaturalMotion) helpers to the Ped class
- added BindKey and BindConsoleCommand to Scripts - thanks to diryboy for the idea!
- added ApplyForce function to Peds, Vehicles and Objects
- the Font width is now determined based on the screen resulution. Use Font.EnforcedWidth to set a custom width.
- added "Scaling" to the Font class, which allows you to scale fonts by Pixels, FontSize or ScreenUnits.
- added Euphoria example (demonstrating Zombie-like movement)
- added BindKey, BindConsoleCommand and PerFrameDrawing examples
- even more stuff

Version 0.82 BETA:
- added an ingame console (tilde key) and some commands for it. type "help" for infos.
- added ConsoleCommand function to scripts, to allow custom console commands
- added console command to reload all scripts during the game and another one to minimize the game window.
- added PerFrameDrawing function to scripts to allow drawing of a simple GUI for scripts
- added Font class to allow custom font styles in PerFrameDrawing
- added basic support for NaturalMotion messages (NmMessage class)
- added simple custom console command example
- key events will trigger now for ALL keys in ALL scripts now. Don't forget to add key checks to your KeyDown events!!!
- WatchKey is no longer needed and was removed
- improved ragdoll commands
- added more functions for positions, directions, offsets, etc. to several objects
- lots of other new functions and bugfixes, as always

Version 0.80 BETA:
- added support for game version 1.0.2.0 (thanks to aru)
- fixed several crashing problems in the constructor of scripts
- Improved performance alot (especially when accessing many objects)
- You can now call Wait() inside Startup() of your script
- It will now reject to load scripts in ranked Multiplayer. thanks to C06alt for the great idea!
- Added basic Object and Animation support
- Added a script example that uses an external configuration file. thanks to CoMPMStR for the idea!
- Added a script example that'll make you smoke a spliff. ;) thanks to iriedreadlock23 for the infos!
- Added a script example that syncs ingame time with realtime
- Improved existing examples
- some minor renames again
- Added more functions, tasks and a bit of everything

Version 0.73 BETA:
- renamed Ped.Tasks to Ped.Task ( sorry, i HAD to do it... it was ugly ^^)

Version 0.72 BETA:
- Scripts reload now if the game reloads
- Fixed wrong color values
- Renamed many functions to make more sense (don't complain, i warned you ;) )
- more examples (including the more complex AnyTaxiScript)
- new Classes/Functionality:
  - Many Tasks and TaskSequences for Peds
  - Native Function support (Native.Function.Call)
  - Minimal Camera support
  - Minimal Blip support
  - MANY more small things... :)

Version 0.70 BETA:
- First public beta release


9. Known Issues
---------------

Not all script functions have been tested. Some of them may not
work as desired or may even lead to crashes.


10. Infos for Webmasters
------------------------

Feel free to add this plugin as a download to your site
as long as you give proper credit. However, as long as
it is technically possible, please DON'T upload it to
other webservers. Best way would be to link to a
official release thread or at least direct-link my
download from your page to assure that people always
get the latest version! 

Official Release Thread:
http://www.gtaforums.com/index.php?showtopic=392325

Direct-Download:
http://www.megamods.de/_data/parts/dl.php?file=83


11. Facts
---------

Data Files:
ScriptHookDotNet.asi

Author:
Hazard (hazard_x@gmx.net)

Releasedate (yyyy-mm-dd):
2009-02-19